Wafer defect inspection apparatus and method for inspecting a wafer defect

ABSTRACT

It is an object to obtain an image of a wafer that is suitable for a defect inspection in an efficient manner. 
     It is judged whether or not an average gray level of an image of a wafer W that is an inspection target and that has been imaged by the light receiving part  2  is in the defect detectable range. A control processing part  6   a  is configured to modify an exposure time in imaging the wafer W and to obtain an image of the wafer W again by the light receiving part  2  in the case in which it is decided that an average gray level of an image of the wafer W is not in a defect detectable range, and an image processing part  6   b  is configured to carry out a defect inspection based on an image of the wafer W in the case in which it is decided that an average gray level of the image of the wafer W is in the defect detectable range.

TECHNICAL FIELD

The present invention relates to a wafer defect inspection apparatusthat is configured to inspect a defect of a wafer based on an image ofthe wafer that has been irradiated with an infrared light and to others.

BACKGROUND ART

A wafer defect inspection apparatus that is configured to inspect adefect that is on the surface or rear face of a wafer or inside a waferhas been known. For such a wafer defect inspection apparatus, onesurface of the principal surfaces of a wafer is irradiated with aninfrared light, the other surface of the principal surfaces of the waferis imaged, and an image analysis processing is executed to the image forinstance. By this configuration, a defect of a wafer is inspected.

For such a defect inspection of a wafer, the actual imaging is carriedout while sampling a part of wafers for every lot in which a pluralityof wafers is brought together for instance. By this configuration, animaging condition (recipe) is decided for setting an average gray levelof an image of a wafer in the range in which a defect can be detected inan appropriate manner (a defect detectable range). By using the recipe,a defect inspection is then carried out to all wafers in the lot.

As a technology related to an imaging in the case of a detection of adefect that is on the surface or rear face of a wafer or inside a waferby using a transmitted light illumination, a technology has been knownin which a value of a specific resistance of a wafer is obtained inadvance, an intensity of illumination of an infrared light illuminatingmeans is adjusted according to the value of a specific resistance, and asensibility to an infrared light of an imaging means is adjusted (seePatent Literature 1).

CITATION LIST Patent Literature

PTL 1

Japanese Patent No. 4358889

SUMMARY OF INVENTION Technical Problem

As described above, a wafer is imaged in accordance with the same recipefor each of wafers in the same lot in a conventional method.

In recent years, a silicon wafer that is provided with a low resistivity(for instance, P⁺⁺ wafer (0.005 to 0.01 Ω·cm)) has been manufactured asa substrate wafer of an epitaxial silicon wafer. In the case in whichthe same recipe is applied to wafers in the same lot, an average graylevel in a defect detectable range cannot be obtained for an image of apart of wafers unfortunately.

FIG. 1 is a view showing a relationship between an average gray level ofeach of wafers in a lot that is a measured target and a defectdetectable range.

As shown in FIG. 1, a recipe that is applied to each lot is decided, andin the case in which a wafer is imaged while the recipe is applied toeach of wafers in the lot, an average gray level of the image of thewafer becomes outside the defect detectable range in a lot of the P⁺⁺wafer (a lot 1 of the P⁺⁺ wafer in FIG. 1) in some cases. Consequently,there is a possibility that a defect cannot be detected in anappropriate manner from an image of the imaged wafer.

On the other hand, in accordance with the technology that is describedin Patent Literature 1, since it is necessary that a measuring apparatusconfigured to measure a specific resistance of a wafer is disposed andthat a specific resistance is measured for a wafer, a time and an effortare required unfortunately.

Moreover, whether or not a defect of a wafer can be detected in anappropriate manner greatly depends on a method for processing an imageof the imaged wafer.

The present invention was made in consideration of such conditions, andan object of the present invention is to provide a technique forobtaining an image of a wafer that is suitable for a defect inspectionin an efficient manner.

Another object of the present invention is to provide a technique fordetecting a defect from an image of a wafer in an appropriate manner.

Solution of Problem

A wafer defect inspection apparatus in accordance with a first aspect ofthe present invention comprises a wafer mounting means configured tomount a wafer that is an inspection target; an irradiation meansconfigured to irradiate the wafer with an infrared light; an imagingmeans configured to image the wafer that has been irradiated with aninfrared light; and an inspection means configured to inspect a defectof the wafer based on an image of the wafer that has been imaged by theimaging means. The wafer defect inspection apparatus further comprises agray level judgment means configured to judge whether or not a referencegray level of an image of the wafer that is an inspection target andthat has been imaged by the imaging means is in the predetermined graylevel range; and a control means configured to modify an exposure timein imaging the wafer and to obtain an image of the wafer again by theimaging means in the case in which it is decided that a reference graylevel of an image of the wafer is not in the predetermined gray levelrange, wherein the inspection means is configured to carry out a defectinspection based on an image of the wafer in the case in which it isdecided that a reference gray level of the image of the wafer is in thepredetermined gray level range.

According to the above wafer defect inspection apparatus, an image inwhich a reference gray level of an image of the wafer is in thepredetermined gray level range can be obtained by modifying an exposuretime in imaging the wafer. Consequently, a defect of a wafer can beinspected in an appropriate manner.

For the above wafer defect inspection apparatus, the irradiation meansis configured to irradiate the wafer with the infrared light in a linepattern, the imaging means is an image line sensor, and the controlmeans is configured to obtain an image of the entire wafer by relativelymoving the irradiation means, the imaging means, and the wafer mountingmeans. According to the above wafer defect inspection apparatus, animage of the entire wafer can be obtained in an appropriate manner.

For the above wafer defect inspection apparatus, the irradiation meansand the imaging means are disposed on the opposite sides from each otheracross the wafer mounted on the wafer mounting means. According to theabove wafer defect inspection apparatus, an image of the wafer that hasbeen irradiated with an infrared light can be obtained by using atransmitted light.

For the above wafer defect inspection apparatus, the control means isconfigured to modify a relative velocity of the irradiation means andthe imaging means to the wafer mounting means and to modify the exposuretime by changing an image capture rate of the imaging means in the casein which it is decided that a reference gray level of an image of thewafer is not in the predetermined gray level range. According to theabove wafer defect inspection apparatus, a gray level of each of thepicture elements for an image of the wafer can be modified in anappropriate manner.

For the above wafer defect inspection apparatus, the control means isconfigured to adjust at least one of the intensity of the infrared lightof the irradiation means or a photodetective sensitivity of the imagingmeans and to obtain an image of the wafer again in the case in which itis decided that a reference gray level of an image of the wafer is notin the predetermined gray level range, and is configured to adjust theexposure time in the case in which the gray level is not in thepredetermined gray level range even if the intensity of the infraredlight and the photodetective sensitivity of the imaging means areadjusted. According to the above wafer defect inspection apparatus,since the exposure time is adjusted in the case in which the gray levelis not in the predetermined gray level range even if the intensity ofthe infrared light and the photodetective sensitivity of the imagingmeans are adjusted, a frequency of an adjustment using the exposure timecan be reduced.

A method for inspecting a wafer defect in accordance with a secondaspect of the present invention comprises the steps of irradiating awafer that is an inspection target with an infrared light, imaging thewafer that has been irradiated with an infrared light, and inspecting adefect of the wafer based on an image of the wafer. The method forinspecting a wafer defect comprises the step of irradiating a wafer withan infrared light and imaging the wafer; the step of judging whether ornot a reference gray level of an image of the wafer that is aninspection target and that has been imaged is in the predetermined graylevel range; the step of modifying the exposure time in imaging thewafer and obtaining an image of the wafer again in the case in which itis decided that a reference gray level of an image of the wafer is notin the predetermined gray level range; and the step of carrying out adefect inspection of the wafer based on an image of the wafer in thecase in which it is decided that a reference gray level of the image ofthe wafer is in the predetermined gray level range.

According to the above method for inspecting a wafer defect, an image inwhich a reference gray level of an image of the wafer is in thepredetermined gray level range can be obtained by modifying an exposuretime in imaging the wafer. Consequently, a defect of a wafer can beinspected in an appropriate manner.

A wafer defect inspection apparatus in accordance with a third aspect ofthe present invention comprises a wafer mounting means configured tomount a wafer that is an inspection target; an irradiation meansconfigured to irradiate the wafer with an infrared light; an imagingmeans configured to image the wafer that has been irradiated with aninfrared light; and an inspection means configured to inspect a defectof the wafer based on an image of the wafer that has been imaged by theimaging means. The wafer defect inspection apparatus further comprises areference average gray level calculation means configured to calculate agray level that has been obtained by averaging gray level of a pluralityof picture elements in the predetermined range including the pictureelement in a plurality of picture elements that are arranged in thepredetermined line direction as a reference average gray level of eachpicture element for the picture elements in a range that is aninspection target of the wafer in the image; a differential valuecalculation means configured to calculate a differential value betweenthe reference average gray level of each of the picture elements and agray level of each of the picture elements; a defect candidate pictureelement judgment means configured to judge whether each of the pictureelements is a defect candidate picture element or not by comparing thedifferential value for each of the picture elements with thepredetermined threshold value; and an inspection means configured toinspect a defect of the wafer based on the defect candidate pictureelement. According to the above wafer defect inspection apparatus, sincewhether or not each of the picture elements is a defect candidatepicture element is judged by comparing a differential value between thereference average gray level of each of the picture elements and a graylevel of each of the picture elements with the threshold value, thenon-uniformity of an image and the influence of a difference of a levelof a gray level for every wafer can be reduced. Consequently, a defectcandidate picture element can be detected in a more appropriate manner.

The above wafer defect inspection apparatus further comprises athreshold value decision means configured to decide the predeterminedthreshold value to each of the picture elements based on the referenceaverage gray level of each of the picture elements. According to theabove wafer defect inspection apparatus, since a threshold value isdecided based on the reference average gray level, the appropriatethreshold value can be decided for every image and a defect can bedetected in an appropriate manner.

For the above wafer defect inspection apparatus, the threshold valuedecision means is configured to decide a value that is obtained bymultiplying the reference average gray level by the predetermined valueas the predetermined threshold value. According to the above waferdefect inspection apparatus, a threshold value can be easily decidedfrom the reference average gray level in an appropriate manner.

For the above wafer defect inspection apparatus, the reference averagegray level calculation means is configured to calculate the referenceaverage gray level while supposing that a gray level of a pictureelement in a region that is exempt from the inspection is a gray levelof a picture element of a boundary with the region that is an inspectiontarget in the case in which a picture element in the predetermined rangein the predetermined line direction is corresponded to the pictureelement in the region that is exempt from the inspection around theouter circumference of the wafer. According to the above wafer defectinspection apparatus, an influence for the reference average gray leveldue to a gray level of a picture element in a range that is exempt fromthe inspection can be reduced and a defect candidate picture element canbe detected in a more appropriate manner.

For the above wafer defect inspection apparatus, the reference averagegray level calculation means is configured to calculate the referenceaverage gray level while supposing that a gray level of a pictureelement in a region that is exempt from the inspection is a gray levelof a picture element at a symmetric position to a boundary with theregion that is an inspection target on the straight line in thepredetermined line direction in the case in which a picture element inthe predetermined range in the predetermined line direction iscorresponded to the picture element in the region that is exempt fromthe inspection around the outer circumference of the wafer. According tothe above wafer defect inspection apparatus, an influence for thereference average gray level due to a gray level of a picture element ina range that is exempt from the inspection can be reduced and a defectcandidate picture element can be detected in a more appropriate manner.

For the above wafer defect inspection apparatus, the inspection meanscomprises a defect candidate region specification means configured tospecify a defect candidate region based on the defect candidate pictureelement; and a defect type judgment means configured to judge whether adefect candidate region is corresponded to the predetermined defect typeor not based on at least one of the concave/convex of a gray levelprofile of the defect candidate region, a gray level ratio that is aratio between the maximum difference of a gray level and a referenceaverage gray level for the defect candidate region and a referenceaverage gray level, a rate of change of a gray level which is themaximum gray level change (an absolute value of an inclination of a graylevel profile) in a range that has been specified for a defect candidateregion boundary, an area of the defect candidate region, a circularityof the defect candidate region, and a ratio between a long width and ashort width in the case in which a center of gravity of the defectcandidate region is supposed as a reference. According to the abovewafer defect inspection apparatus, a defect candidate region that iscorresponded to the predetermined defect type can be decided in anappropriate manner.

For the above wafer defect inspection apparatus, the inspection meansfurther comprises an acceptance judgment means configured to judgewhether the wafer is acceptable or not as a product based on the numberof defect candidate regions that are corresponded to the predetermineddefect type. According to the above wafer defect inspection apparatus,it is possible to judge whether the wafer is acceptable or not as aproduct in an appropriate manner.

A method for inspecting a wafer defect in accordance with a fourthaspect of the present invention is a method for inspecting a waferdefect based on an image of a wafer that is an inspection target andcomprises the step of calculating a gray level that has been obtained byaveraging gray level of a plurality of picture elements in thepredetermined range including the picture element in a plurality ofpicture elements that are arranged in the predetermined line directionas a reference average gray level of each picture element for thepicture elements in a range that is an inspection target of the wafer inthe image; the step of calculating a differential value between thereference average gray level of each of the picture elements and a graylevel of each of the picture elements; the step of judging whether eachof the picture elements is a defect candidate picture element or not bycomparing the differential value for each of the picture elements withthe predetermined threshold value; and the step of inspecting a defectof the wafer based on the defect candidate picture element. According tothe above wafer defect inspection apparatus, since whether or not eachof the picture elements is a defect candidate picture element is judgedby comparing a differential value between the reference average graylevel of each of the picture elements and a gray level of each of thepicture elements with the threshold value, the non-uniformity of animage and the influence of a difference of a grayscale level of a graylevel for every wafer can be reduced. Consequently, a defect candidatepicture element can be detected in a more appropriate manner.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a view showing a relationship between an average gray level ofeach of wafers in a lot that is a measured target and a defectdetectable range.

FIG. 2 is a block diagram of a wafer defect inspection apparatus inaccordance with an embodiment of the present invention.

FIG. 3 is a view showing an example of a gray level profile that isdetected by a defect inspection in accordance with an embodiment of thepresent invention.

FIG. 4 is a view showing a defect judgment table in accordance with anembodiment of the present invention.

FIG. 5 is a flowchart of a defect inspection processing in accordancewith an embodiment of the present invention.

FIG. 6 is a view illustrating a relationship between the resistivity ofa wafer and an average gray level of an image of a wafer to a pluralityof image obtaining conditions in accordance with an embodiment of thepresent invention.

FIG. 7 is a flowchart of a defect detection image analysis processing inaccordance with an embodiment of the present invention.

FIG. 8 is a view illustrating a binarization processing in accordancewith an embodiment of the present invention.

FIG. 9 is a view illustrating a binarization processing in accordancewith an embodiment of the present invention.

FIG. 10 is a view illustrating a binarization processing in which a graylevel threshold value has been modified in accordance with an embodimentof the present invention.

FIG. 11 is a view illustrating a calculation method of a moving averagegray level in accordance with a modification example of the presentinvention.

MODE FOR CARRYING OUT THE INVENTION

An embodiment of the present invention will be described below in detailwith reference to the drawings. The preferred embodiments that will bedescribed in the following do not limit the present invention inaccordance with the claims, and all of the elements and combinationsthereof that will be described in the embodiments are not essential forsolution means of the present invention.

A wafer defect inspection apparatus in accordance with an embodiment ofthe present invention will be described in detail in the following.

FIG. 2 is a block diagram of a wafer defect inspection apparatus inaccordance with an embodiment of the present invention. FIG. 2A is ablock diagram of a wafer defect inspection apparatus that is viewed froma side face, and FIG. 2B is a block diagram of an inspection stage of awafer defect inspection apparatus that is viewed from up above.

A wafer defect inspection apparatus 1 is provided with an inspectionstage 3 that is an example of a wafer mounting means that is configuredto mount a wafer W that is an inspection target, at least oneilluminating part 4 that is configured to irradiate the wafer with aninfrared light, a light guide 5 that is configured to shape an infraredlight that has been irradiated from the illuminating part 4 to be alight in a line pattern that is provided with the light intensity almostequivalent to that of the infrared light and to project the light to thewafer W, at least one light receiving part 2 that is an example of animaging means that is configured to capture an image of the wafer W, anda processing apparatus 6. The illuminating part 4 and the light guide 5configure an illuminating means.

The light receiving part 2 is provided with an image line sensor havingthe sensitivity to an infrared light, and is placed in such a mannerthat a light receiving face of the image line sensor is facing theinspection stage 3, that is, facing downward. For the presentembodiment, each of the light receiving parts 2 is used for capturing animage of a half of the wafer W (the light receiving part 2 on the leftside in FIG. 2A captures an image of the left half face of the wafer Wand the light receiving part 2 on the right side in FIG. 2A captures animage of the right half face of the wafer W).

For the wafer defect inspection apparatus 1, the light guide 5 and theimage line sensor of each of the light receiving parts 2 are disposed onthe opposite sides from each other across the inspection stage 3. Inother words, a light in a line pattern that is projected by the lightguide 5 travels along the line of the image line sensor of the lightreceiving part 2.

The inspection stage 3 can move linearly in the Y direction (aperpendicular direction of the plane of the paper of FIG. 2A, a verticaldirection in FIG. 2B).

The processing apparatus 6 is provided with a control processing part 6a that is an example of a gray level judgment means and a control means,an image processing part 6 b that is an example of a reference averagegray level calculation means, a differential value calculation means, adefect candidate picture element judgment means, a threshold valuedecision means, an inspection means, a defect candidate regionspecification means, a defect type judgment means, and an acceptancejudgment means, and a defect judgment table 6 c.

The control processing part 6 a is configured to control the sensitivity(gain) to the intensity of a light for the image line sensor of thelight receiving part 2. Moreover, the control processing part 6 a isconfigured to control an image capture rate for the image line sensor ofthe light receiving part 2. In the present embodiment, the controlprocessing part 6 a controls the light receiving part 2 by transmittingthe light receiving part configuration information including aphotodetective condition (the sensitivity) and a part of the exposureconditions (an image capture rate) to the light receiving part 2.Moreover, the control processing part 6 a receives the image data of thewafer W that has been imaged by the light receiving part 2 (the graylevel data of each of the picture elements) and sends the data to theimage processing part 6 b. Furthermore, the control processing part 6 acontrols the intensity of the infrared light that is irradiated by theilluminating part 4. In the present embodiment, the control processingpart 6 a controls the illuminating part 4 by transmitting the lightsource configuration information including an irradiation condition (theintensity of a light) to the illuminating part 4. Moreover, the controlprocessing part 6 a controls a moving speed of the inspection stage 3.In the present embodiment, the control processing part 6 a controls amoving speed of the inspection stage 3 by transmitting the speedconfiguration information including a part of the exposure conditions (aspecification of a moving speed) to a driving part (not shown) of theinspection stage 3.

The image processing part 6 b executes a defect detection image analysisprocessing in which a defect of the wafer W is inspected based on theimage data that has been sent from the control processing part 6 a. Theimage processing part 6 b executes the processing by using the defectjudgment table 6 c (see Table 4) that stores a condition for specifyinga type of a defect (a defect classification condition) and a conditionfor deciding an acceptance/rejection of a wafer (whether the wafer isacceptable or not as a product) (an acceptance judgment condition) inthe defect detection image analysis processing. The processing of theimage processing part 6 b will be described later in detail.

FIG. 3 is a view showing an example of a gray level profile that isdetected by a defect inspection in accordance with an embodiment of thepresent invention.

As a type of a defect of the wafer W, there can be mentioned forinstance a defect having a wide variety of different generation modessuch as a void (air bubble), a film pinhole, a contamination, a stainspot, a foreign matter, a flaw, and a crack. Consequently, as shown inFIG. 3, a gray level of a defect region is below a moving average graylevel that is described later, whereby a shape of a profile of a graylevel is detected in a concave pattern (defects A to E), or a gray levelof a defect region is above a moving average gray level, whereby a shapeof a profile of a gray level is detected in a convex pattern (defect F)for instance depending on a type of a defect. In other words, a graylevel profile that is detected is different depending on a type of adefect. In the case in which a shape of a gray level profile that hasbeen detected is in a similar concave pattern (for instance, defects Ato E), a type of a defect cannot be distinctly decided by only a graylevel profile in some cases. However, a type of a defect can be decidedby a circularity described later or a ratio between the longest straightline (the maximum width) and the shortest straight line (the minimumwidth) that pass through a gravity center G of the defect region.

FIG. 4 is a view showing a defect judgment table in accordance with anembodiment of the present invention.

The defect judgment table 6 c can store a plurality of records that areprovided with a classification name field 60, a defect classificationcondition field 61, and an acceptance judgment condition field 62. Eachof the configurations for the defect judgment table 6 c can be decidedin a fixed manner, or a user can decide the configurations in anappropriate manner by using an input apparatus (not shown).

The classification name field 60 stores a classification name of adefect.

The defect classification condition field 61 stores a condition inclassifying a defect for a defect candidate region that is describedlater (a defect classification condition). In the present embodiment,the defect classification condition field 61 is provided with aconcave/convex field 61 a, a gray level ratio field 61 b, a gray levelchange rate field 61 c, an area field 61 d, a circularity field 61 e,and a long and short ratio field 61 f. In the defect classificationcondition field 61 of the present embodiment, at least one condition ofthe conditions that are indicated by the fields 61 a to 61 f is set. Ina condition that is used for the classification, a value for thecondition is set. On the other hand, in a condition that is not used forthe classification, a non-setting symbol that indicates a non-setting isshown (“-” is shown in the present embodiment).

In the concave/convex field 61 a, a concave or a convex of a gray levelprofile, which is a condition for judging a defect of a correspondedclassification, is set for a defect candidate region. More specifically,a condition is set for judging whether a gray level profile of theregion is in a concave pattern (a low state) or in a convex pattern (ahigh state) to a moving average gray level of the region. In the graylevel ratio field 61 b, the minimum value (Min) and/or the maximum value(Max) of a gray level ratio that is a condition for judging a defect ofa corresponded classification are set for a ratio (a gray level ratio)of a moving average gray level and the maximum value of a differencebetween a gray level in a defect candidate region and a moving averagegray level. In the gray level change rate field 61 c, the minimum value(Min) and/or the maximum value (Max) of a gray level change rate that isa condition for judging a defect of a corresponded classification areset. The gray level change rate indicates the maximum value of a changeof a gray level (an absolute value of an inclination of a gray levelprofile) in a range that has been specified in advance for a defectcandidate region boundary that passes through a gravity center G. In thearea field 61 d, the minimum value (Min) and/or the maximum value (Max)of an area S that is a condition for judging a defect of a correspondedclassification are set. In the circularity field 61 e, the minimum value(Min) and/or the maximum value (Max) of a circularity that is acondition for judging a defect of a corresponded classification are set.In the long and short ratio field 61 f, the minimum value (Min) and/orthe maximum value (Max) of the long and short ratio that is a conditionfor judging a defect of a corresponded classification are set. The longand short ratio indicates a ratio between the longest straight line (themaximum width) and the shortest straight line (the minimum width) thatpass through a gravity center G for the target region.

The acceptance judgment condition field 62 is provided with a lengthfield 62 a and a number field 62 b.

The length field 62 a stores a length that is permissible as a productof a wafer to a defect region that is classified as a correspondeddefect classification, which is a condition that is used for anacceptance judgment. More specifically, it is indicated that a wafer isacceptable as a product in the case in which a length of a defect thathas been decided as a corresponded defect classification is within apermissible length, and a wafer is unacceptable as a product in the casein which a length of a defect exceeds a permissible length. The numberfield 62 b stores a number (a permissible number) that is permissible asa defect region that is classified as a corresponded defectclassification, which is a condition that is used for an acceptancejudgment. More specifically, it is indicated that a wafer isunacceptable as a product in the case in which the number of defectsthat have been decided as a corresponded defect classification exceeds apermissible number. In the fields 62 a and 62 b, a numerical value isset for a condition that is used for an acceptance judgment, and anon-setting symbol that indicates a non-setting is shown in a conditionthat is not used for an acceptance judgment (“-” is shown in the presentembodiment).

For a condition that is classified as a defect B that is a second recordin FIG. 4 for instance, it is indicated that the wafer is acceptable asa product in the case in which a gray level profile is in a concavepattern, a gray level ratio is in the range of 0.70 to 1.00, an area Sis at least 30 (picture elements), a circularity e is in the range of0.60 to 0.90, the long and short ratio is in the range of 1.50 to 2.00,and there are up to three defect regions that are classified as thedefect B.

FIG. 5 is a flowchart of a defect inspection processing in accordancewith an embodiment of the present invention.

In the first place, the control processing part 6 a sets an initialvalue to a setting condition in obtaining an image of the wafer W (animage obtaining condition) (step S1). More specifically, the controlprocessing part 6 a sets an initial value I₀ to an irradiation conditionI_(n) for the illuminating part 4, an initial value G₀ to aphotodetective condition G_(n) for the light receiving part 2, and aninitial value SS₀ to an exposure condition SS_(n) that is correspondedto an exposure time (an image capture rate of the light receiving part 2and a moving speed of the inspection stage 3). In the presentembodiment, the initial value I₀ is the light intensity value smallestin the range of an intensity of a light that is used in obtaining animage. The initial value G₀ is the gain value smallest in the range of again that is used in obtaining an image. The initial value SS₀ is avalue that is corresponded to the exposure time shortest in exposureconditions that are used in obtaining an image. (In the presentembodiment, the initial value SS₀ is the moving speed highest in therange of a moving speed that is used in obtaining an image, and is theimage capture rate highest in the range of an image capture rate that isused in obtaining an image.)

In the next place, the control processing part 6 a sets a settingcondition in obtaining an image of the wafer W to the light receivingpart 2, the inspection stage 3, and the illuminating part 4 (step S2),and obtains an image of the entire wafer W from the light receiving part2 by operating the light receiving part 2, the inspection stage 3, andthe illuminating part 4 (step S3).

In the next place, the control processing part 6 a judges whether or notan average gray level of an image that has been obtained is in apermissible gray level range (a permissible range: a defect detectablerange) (step S4). For instance, the control processing part 6 a carriesout a judgment depending on whether |A_(n)−A_(t)|≦δA_(t) is satisfied ornot, where A_(n) is an average gray level of an image of the wafer W,A_(t) is a central gray level of a permissible range, and δA_(t) is apermissible shift intensity from the central gray level of a permissiblerange. The permissible range can be represented as A_(t)±δA_(t). Thepermissible range can be in the range of 70 to 170 in the case in whicha value of a gray level is in the range of 0 to 255 for instance.

As a result, in the case in which it is decided that an average graylevel is in a permissible range (step S4: YES), it is indicated that theimage is provided with a gray level that is suitable for a defectdetection. Consequently, the control processing part 6 a sends an imagedata to the image processing part 6 b and makes the image processingpart 6 b to execute a defect detection image analysis processing (stepS5).

On the other hand, in the case in which it is decided that an averagegray level is not in a permissible range (step S4: NO), it is indicatedthat the image is not provided with a gray level that is suitable for adefect detection. Consequently, the control processing part 6 adetermines an irradiation condition candidate I_(x) for obtaining animage that is provided with a gray level that is more suitable (stepS6). In the present embodiment, the control processing part 6 a obtainsthe irradiation condition candidate I_(x) by calculatingI_(x)=k*A_(t)/A_(n)*I_(n), where k is a predetermined coefficient.

In the next place, the control processing part 6 a judges whether or notthe irradiation condition candidate I_(x) is in a range that can be set,that is, the irradiation condition candidate I_(x) satisfies I_(min)≦I_(x)≦I_(max) (I_(min): the settable minimum value of I, I_(max): thesettable maximum value of I) (step S7). In the case in which it isdecided that the irradiation condition candidate I_(x) is in a rangethat can be set (step S7: YES), the irradiation condition candidateI_(x) is determined as an irradiation condition I_(n) (step S8) and thestep S2 is then executed. By this configuration, an irradiationcondition (an intensity of a light of the illuminating part 4) can bemodified in such a manner that an average gray level of an image of thewafer W comes close to the permissible range.

On the other hand, in the case in which it is decided that theirradiation condition candidate I_(x) is not in a range that can be set(step S7: NO), the control processing part 6 a determines aphotodetective condition candidate G_(x) for obtaining an image that isprovided with a gray level that is more suitable (step S9). In thepresent embodiment, the control processing part 6 a obtains thephotodetective condition candidate G_(x) by calculatingG_(x)=l*A_(t)/A_(n)*G_(n), where l is a predetermined coefficient.

In the next place, the control processing part 6 a judges whether or notthe photodetective condition candidate G_(x) is in a range that can beset, that is, the photodetective condition candidate G_(x) satisfiesG_(min) ≦G_(x)≦G_(max) (G_(min): the settable minimum value of G,G_(max): the settable maximum value of G) (step S10). In the case inwhich it is decided that the photodetective condition candidate G_(x) isin a range that can be set (step S10: YES), the photodetective conditioncandidate G_(x) is determined as a photodetective condition G_(n) (stepS11) and the step S2 is then executed. By this configuration, aphotodetective condition (a gain of the light receiving part 2) can bemodified in such a manner that an average gray level of an image of thewafer W comes close to the permissible range.

On the other hand, in the case in which it is decided that thephotodetective condition candidate G_(x) is not in a range that can beset (step S10: NO), the control processing part 6 a determines anexposure condition candidate SS_(x) for obtaining an image that isprovided with a gray level that is more suitable (step S12). In thepresent embodiment, the control processing part 6 a determines thecondition in which an exposure time is longer than SS_(n) as theexposure condition candidate SS_(x) (the condition in which a movingspeed of the inspection stage 3 is made lower and an image capture rateof the light receiving part 2 is made lower).

In the next place, the control processing part 6 a judges whether or notthe exposure condition candidate SS_(x) is in a range that can be set(step S13). In the case in which it is decided that the exposurecondition candidate SS_(x) is in a range that can be set (step S13:YES), the exposure condition candidate SS_(x) is determined as anexposure condition SS_(n) (step S14) and the step S2 is then executed.By this configuration, an exposure condition (a moving speed of theinspection stage 3 and an image capture rate of the light receiving part2) can be modified in such a manner that an average gray level of animage of the wafer W comes close to the permissible range.

On the other hand, in the case in which it is decided that the exposurecondition candidate SS_(x) is not in a range that can be set (step S13:NO), an exposure condition cannot be modified, which means that acondition for obtaining an image that is provided with a suitable graylevel cannot be set. Consequently, the control processing part 6 aexecutes an error indication on a display apparatus not shown (stepS15).

By the above configuration, an image obtaining condition in obtaining animage of the wafer W can be adjusted and an image that is provided witha gray level suitable for the defect detection for the wafer W can beobtained in an appropriate manner.

FIG. 6 is a view illustrating a relationship between the resistivity ofa wafer and an average gray level of an image of a wafer to a pluralityof image obtaining conditions in accordance with an embodiment of thepresent invention. FIG. 6A is a view illustrating a relationship betweenthe resistivity of a wafer W and an average gray level of the wafer W toa plurality of image obtaining conditions. FIG. 6B is a viewillustrating the image obtaining conditions (1) to (6).

As shown in the case in which a condition (1) is changed to a condition(2) for instance, only a gain of the light receiving part 2 isincreased. In this case, as shown in the graph that is corresponded tothe condition (1) and the condition (2) of FIG. 6A, an average graylevel of an image of the wafer W that is provided with a lowerresistivity can be included in a defect detectable range. In otherwords, an image of the wafer W that is provided with a lower resistivitycan be captured in an appropriate manner.

As shown in the case in which a condition (2) is changed to a condition(3) for instance, a gain of the light receiving part 2 is increased andan intensity of a light of the illuminating part 4 is increased. In thiscase, as shown in the graph that is corresponded to the condition (2)and the condition (3) of FIG. 6A, an average gray level of an image ofthe wafer W that is provided with a lower resistivity can be included ina defect detectable range. In other words, an image of the wafer W thatis provided with a lower resistivity can be captured in an appropriatemanner.

As shown in the case in which a condition (2) is changed to a condition(4) for instance, a moving speed of the inspection stage 3 is made lowerand an image capture rate of the light receiving part 2 is made lower.In other words, an exposure time is made longer. In this case, as shownin the graph that is corresponded to the condition (2) and the condition(4) of FIG. 6A, an average gray level of an image of the wafer W that isprovided with a lower resistivity can be included in a defect detectablerange. In other words, an image of the wafer W that is provided with alower resistivity can be captured in an appropriate manner.

As shown in the case of a condition (6) for instance, a gain of thelight receiving part 2 is maximized, an intensity of a light of theilluminating part 4 is maximized, and a moving speed of the inspectionstage 3 is made lower. In this case, as shown in the graph that iscorresponded to the condition (6) of FIG. 6A, an average gray level ofan image of the wafer W that is provided with a lower resistivity can beincluded in a defect detectable range.

As described above, an average gray level of an image of the wafer Wthat is an inspection target can be adjusted by changing at least one ofa gain of the light receiving part 2, an intensity of a light of theilluminating part 4, and a moving speed of the inspection stage 3 (andan image capture rate of the light receiving part 2). Consequently, anaverage gray level of an image can be set in a defect detectable rangein an appropriate manner.

FIG. 7 is a flowchart of a defect detection image analysis processing inaccordance with an embodiment of the present invention.

In the defect detection image analysis processing, the image processingpart 6 b executes a smoothing processing of each of the picture elementsby using the image data of the wafer W (the original image data) thathas been received from the control processing part 6 a (step S21). Inthe smoothing processing, a gray level of the picture element that is atarget is an average value of the gray level of n×n (for instance, 3×3)picture elements in which the target picture element is a center. In thepresent embodiment, the smoothing processing is executed for all pictureelements of the image data, and the smoothing processing is executedmultiple times. By this processing, the causes of error in the imagedata can be reduced.

In the next place, the image processing part 6 b executes apredetermined differentiation filter processing for the image data (stepS22). In the differentiation filter processing, a differentiation filtercan be applied to the X direction (a direction perpendicular to themoving direction of the inspection stage 3: see FIG. 2) or can beapplied to the Y direction (the moving direction of the inspection stage3), and Laplacian can also be applied.

The image processing part 6 b calculates a moving average gray level (areference average gray level) of each of the picture elements by usingthe image data after the differentiation filter processing (step S23).In the present embodiment, a moving average gray level to each of thepicture elements is obtained by averaging the gray level of pictureelements of the predetermined number in the X direction somewhere aroundthe picture element (for instance, 100 picture elements somewhere aroundthe picture element). Moreover, a moving average gray level to each ofthe picture elements can also be obtained by averaging the gray level ofpicture elements of the predetermined number in the Y directionsomewhere around the picture element (for instance, 100 picture elementssomewhere around the picture element).

In the next place, the image processing part 6 b calculates a gray levelthreshold value that is used for judging whether or not a pictureelement is a defect candidate picture element based on the movingaverage gray level of each of the picture elements (step S24). In thepresent embodiment, a value that is obtained by multiplying the movingaverage gray level of each of the picture elements by a predeterminedcoefficient (for instance, 0.3) is a gray level threshold value to eachof the picture elements for instance. A fixed value can also be used asa gray level threshold value.

In the next place, the image processing part 6 b executes a binarizationprocessing for generating the binary image data (the binarization imagedata) that indicates whether or not a picture element is a defectcandidate picture element by calculating a differential value (anabsolute value of a difference) between a gray level of each of thepicture elements of the image data and the moving average gray level ofeach of the picture elements and by comparing the differential value toeach of the picture elements with the gray level threshold value thathas been calculated to each of the picture elements (step S25). In thebinarization processing, the data is converted to data that indicatesthat a picture element is a defect candidate picture element (forinstance, 0: black) in the case in which a differential value for apicture element exceeds the gray level threshold value, and the data isconverted to data that indicates that a picture element is not a defectcandidate picture element (for instance, 1: white) in other cases.

In the next place, the image processing part 6 b executes an dilationprocessing of a white color to the binarization image data that has beenobtained in the step S25 (step S26). In the dilation processing, in thecase in which there are more white picture elements in the range of n×npicture elements (n is a predetermined integer number) that includes thepicture element for each of the picture elements for instance, the imageprocessing part 6 b executes a processing for making the picture elementto be white. By the dilation processing, picture elements that isthought to be miscellaneous data in which one black picture element isincluded in white picture elements can be changed to white pictureelements for instance. The dilation processing can be executed multipletimes.

In the next place, the image processing part 6 b executes a erosionprocessing of a white picture element (data provided with a value of“1”) to the image data to which the dilation processing has beenexecuted (step S27). In the erosion processing, in the case in whichthere are less white picture elements in the range of n×n pictureelements (n is a predetermined integer number) that includes the pictureelement for each of the picture elements for instance, the imageprocessing part 6 b executes a processing for making the picture elementto be black. By the erosion processing, a region of black that has beensmaller by an influence of the dilation processing that has beenexecuted in advance can be made larger, that is, made to be close to theoriginal state. The erosion processing can be executed multiple times.

In the next place, in such a manner that defect candidate pictureelements (black picture elements) that are connected to each other inthe image data are handled as one gathering (a defect candidate region),the image processing part 6 b executes a labeling processing for makinga number correspond to the defect candidate region (step S28).

In the next place, the image processing part 6 b executes a shapefeature extraction processing for extracting a variety of shapeparameters for each of the defect candidate regions to which a numberhas been corresponded (step S29). In the present embodiment, the imageprocessing part 6 b extracts an area S that is a total sum of the numberof picture elements of the defect candidate region, a circumferentiallength l that is a length of a boundary line of the defect candidateregion, a circularity e (e=4πS/l²) of the defect candidate region, agravity center position G of the defect candidate region, and the longand short ratio between a long straight line and a short straight linethat pass through the gravity center position G.

In the next place, the image processing part 6 b obtains the partialimage data that includes the defect candidate region and the peripherythereof (for instance, a region that includes picture elements of apredetermined number in the vertical and horizontal directions of eachof the picture elements) from the original image data (step S30).

In the next place, the image processing part 6 b executes a gray levelfeature extraction processing for extracting a variety of gray levelparameters for each of the defect candidate regions (step S31). In thepresent embodiment, the image processing part 6 b decides theconcave/convex of a gray level profile of the defect candidate regionaccording to whether a profile of a gray level is plus or minus to themoving average gray level by using the partial image data, and obtains aratio between the maximum difference of a gray level of the defectcandidate region and the reference average gray level and the referenceaverage gray level. Moreover, the image processing part 6 b obtains themaximum gray level change rate (an absolute value of an inclination of agray level profile) in the range that has been specified in advance foreach of the boundary regions in the X and Y directions of a gray levelprofile that passes through the gravity center position G, and averagesthe gray level change rates at the four points that has been obtained.By this processing, an average gray level change rate |a|_(ave) iscalculated. The concave/convex of a gray level profile, the gray levelratio, and the average gray level change rate are also featureparameters that are related to the defect candidate region.

In the next place, the image processing part 6 b judges whether thewafer W is acceptable or not as a product by using the featureparameters (a shape parameter and a gray level parameter) that have beencalculated for each of the defect candidate regions and the defectjudgment table 6 c (step S32). More specifically, the image processingpart 6 b takes a first record from the defect judgment table 6 c, andspecifies a type of a defect according to whether or not the featureparameters for each of the defect candidate regions satisfy a defectclassification condition that has been set for the record. Moreover, theimage processing part 6 b judges whether the wafer W is acceptable ornot as a product according to whether or not an acceptance judgmentcondition of the record is satisfied. The image processing part 6 b thentakes all records of the defect judgment table 6 c, and executes theabove similar processing. By this processing, a type of a defect of thewafer W can be specified, and it can be judged whether the wafer isacceptable or not as a product in an appropriate manner.

FIG. 8 is a view illustrating a binarization processing in accordancewith an embodiment of the present invention.

In the present embodiment, as shown in the step S25, the imageprocessing part 6 b executes the binarization processing by calculatinga differential value between the moving average gray level of each ofthe picture elements and an image gray level and by comparing thedifferential value with the gray level threshold value. By using adifferential value between a moving average gray level and an image graylevel as described above, the non-uniformity of an image and theinfluence of a difference of a gray level for every wafer can bereduced. Consequently, a defect part can be detected in a moreappropriate manner.

FIG. 9 is a view illustrating a binarization processing in accordancewith an embodiment of the present invention.

More specifically, FIG. 9A shows an image in which non-uniformity hasoccurred and the gray level profile thereof. FIGS. 9B and 9C show theresults of the execution of the binarization processing in the state inwhich the non-uniformity of an image has occurred. In the case in whicha threshold value is applied to an image gray level in the state inwhich the non-uniformity of an image has occurred as shown in FIG. 9B,an image non-uniformity region other than a defect part is also a targetof the binarization processing. However, a defect part can be detectedin an appropriate manner without an influence of the non-uniformity ofan image by applying a threshold value to a differential value as shownin FIG. 9C.

FIG. 10 is a view illustrating a binarization processing in which a graylevel threshold value has been modified in accordance with an embodimentof the present invention.

More specifically, FIG. 10 shows the result of a detection of a defectafter obtaining images that are provided with different average graylevel for a defect of 100 μm that exists in the face of the wafer W.FIG. 10A shows the result of a detection of a defect for an image thatis provided with a low gray level. FIG. 10B shows the result of adetection of a defect for an image that is provided with a high graylevel.

As shown in FIGS. 10A and 10B, a defect that exists in the wafer W canbe detected in an appropriate manner by modifying a gray level thresholdvalue according to a grayscale level of an image. In the presentembodiment, a gray level threshold value is decided by multiplying themoving average gray level by a predetermined coefficient, and the higherthe moving average gray level is, the higher the gray level thresholdvalue is. Consequently, a defect of the wafer W can be detected in amore appropriate manner

While the preferred embodiments in accordance with the present inventionhave been described above, the embodiments are examples for describingthe present invention and the scope of the present invention is notrestricted to the embodiments. It is obvious that various changes,modifications, and functional additions can be thus made withoutdeparting from the scope of the present invention.

The first and second modification examples that are modificationexamples in accordance with the present invention will be described inthe following.

FIG. 11 is a view illustrating a calculation method of a moving averagegray level in accordance with a modification example of the presentinvention.

For the wafer defect inspection apparatus 1 in accordance with the aboveembodiment, there are less intensity of a transmitted light at theperiphery of the wafer W due to an influence of the non-uniformity of anillumination and a sagging of the periphery of the wafer. Consequently,as shown in FIG. 11(1), a region around the periphery of the wafer W isset as a region that is not an inspection target (a mask region).

In the above embodiment, as shown in FIG. 11(2), a moving average graylevel to each of the picture elements is obtained by averaging the graylevel of 100 picture elements somewhere around the picture element inthe predetermined direction (for instance, in the X direction).Consequently, for the picture element of the inspection region close tothe mask region of the wafer W, a moving average gray level becomeslower due to an influence of a gray level of the picture element in themask region, and there is a possibility that the error detection iscarried out as a defect candidate picture element. In the case in whichthere is the non-uniformity of an image in the inspection region closeto the mask region as shown in FIG. 11(1) for instance, a differentialvalue between a gray level of the non-uniformity part of the image andthe moving average gray level of the part exceeds the threshold value asshown in FIG. 11(2). Therefore, the error detection of the pictureelement of the non-uniformity part of the image may be carried out as adefect candidate picture element in some cases.

On the other hand, for a first modification example, a moving averagegray level of each of the picture elements is calculated while supposingthat a gray level of a picture element in the mask region is equivalentto a gray level of a picture element at a boundary part between the maskregion and the inspection region. By this configuration, even in thecase in which there is the non-uniformity of an image as shown in FIG.11(1), a differential value between a gray level of the non-uniformitypart of the image and the moving average gray level of the part does notexceed the threshold value as shown in FIG. 11(3). Therefore, the errordetection of the picture element of the non-uniformity part of the imageis not carried out as a defect candidate picture element.

Moreover, for a second modification example, a moving average gray levelof each of the picture elements is calculated while supposing that agray level of a picture element in the mask region is equivalent to agray level of a picture element at a symmetric position to a boundarypart between the mask region and the inspection region. By thisconfiguration, even in the case in which there is the non-uniformity ofan image as shown in FIG. 11(1), a differential value between a graylevel of the non-uniformity part of the image and the moving averagegray level of the part does not exceed the threshold value as shown inFIG. 11(4). Therefore, the error detection of the picture element of thenon-uniformity part of the image is not carried out as a defectcandidate picture element. As a result, the error detection of a defectcan be reduced.

The present invention can also be configured as described in thefollowing. In above embodiment for instance, the entire image of thewafer W is obtained by moving the inspection stage 3. However, theentire image of the wafer W can also be obtained by moving the lightreceiving part 2, the illuminating part 4, and the light guide 5 withoutmoving the inspection stage 3 for instance. The point is that the entireimage of the wafer W is obtained by moving the inspection stage 3, thelight receiving part 2, the illuminating part 4, and the light guide 5in a relative manner.

In above embodiment moreover, an average gray level of an image of thewafer W is used as a gray level that is a reference of an image of thewafer. However, the present invention is not restricted to thisconfiguration, and the darkest gray level of an image of the wafer W canalso be used for instance. Moreover, an average gray level of aninspection region of the wafer W can also be used.

In above embodiment moreover, an irradiation condition of theilluminating part 4 is modified, a photodetective condition of the lightreceiving part 2 is then modified in the case in which the irradiationcondition cannot be modified, and an exposure condition is then modifiedin the case in which the photodetective condition cannot be modified.However, the present invention is not restricted to this configuration,and a sequence of a modification of the irradiation condition, thephotodetective condition, and the exposure condition can also be changedto a different sequence. Moreover, a plurality of conditions of theirradiation condition, the photodetective condition, and the exposurecondition can also be modified at one time. Furthermore, a plurality ofsets of the irradiation condition, the photodetective condition, and theexposure condition is prepared for instance, and a modification targetthat is used can also be selected from the sets.

In above embodiment moreover, a moving average gray level is calculatedby using the image data in which a smoothing processing and adifferentiation filter processing are executed to the original imagedata. However, a moving average gray level can also be calculated byusing the original image data without executing the smoothing processingand the differentiation filter processing.

REFERENCE SIGNS LIST

-   1: Wafer defect inspection apparatus-   2: Light receiving part-   3: Inspection stage-   4: Illuminating part-   5: Light guide-   6: Processing apparatus-   6 a: Control processing part-   6 b: Image processing part-   6 c: Defect judgment table-   W: Wafer

The invention claimed is:
 1. A wafer defect inspection apparatus,comprising: a wafer mount configured to mount a wafer that is aninspection target; an irradiator configured to irradiate the wafer withan infrared light; an imager configured to image the wafer that has beenirradiated with the infrared light; a reference moving average graylevel calculator configured to calculate a gray level that has beenobtained by averaging gray levels of a plurality of picture elements inthe a predetermined range including an inspection target picture elementin a plurality of picture elements that are arranged in the apredetermined line direction as a reference moving average gray level ofthe inspection target picture element for each of the inspection targetpicture elements in a region that is an inspection target of the waferin an image of the wafer that has been imaged by the imager; adifferential value calculator configured to calculate a differentialvalue between the reference moving average gray level of the inspectiontarget picture element and a gray level of the inspection target pictureelement for each of the inspection target picture elements; a defectcandidate picture element judger configured to judge whether each of theinspection target picture elements is a defect candidate picture elementby comparing the differential value for each of the inspection targetpicture elements with the a predetermined threshold value; and aninspector configured to inspect a defect of the wafer based on thedefect candidate picture element.
 2. The wafer defect inspectionapparatus according to claim 1, wherein the reference moving averagegray level calculator is configured to calculate the reference movingaverage gray level, where a gray level of a picture element, in a regionthat is exempt from the inspection, is a boundary with the region thatis an inspection target, when a picture element in the predeterminedrange in the predetermined line direction corresponds to the pictureelement in the region that is exempt from the inspection around theouter circumference of the wafer.
 3. The wafer defect inspectionapparatus according to claim 1, wherein the reference moving averagegray level calculator is configured to calculate the reference movingaverage gray level, where a gray level of a picture element, in a regionthat is exempt from the inspection, is at a symmetric position to aboundary with the region that is an inspection target on the straightline in the predetermined line direction, when a picture element in thepredetermined range in the predetermined line direction corresponds tothe picture element in the region that is exempt from the inspectionaround the outer circumference of the wafer.
 4. The wafer defectinspection apparatus according to claim 1, wherein the inspectorcomprises: a defect candidate region specifier configured to specify adefect candidate region based on the defect candidate picture element;and a defect type judger configured to judge whether a defect candidateregion is corresponded to the predetermined defect type based on atleast one of the concave/convex of a gray level profile of the defectcandidate region, a gray level ratio that is a ratio between the maximumdifference of a gray level and a reference moving average gray level forthe defect candidate region and a reference moving average gray level,an average gray level change rate of the defect candidate region, anarea of the defect candidate region, a circularity of the defectcandidate region, and a ratio between a long width and a short widthwhen a center of gravity of the defect candidate region is a reference.5. The wafer defect inspection apparatus according to claim 1, whereinthe inspector further comprises an acceptance judger configured to judgewhether the wafer is acceptable as a product based on the number ofdefect candidate regions that are corresponded to the predetermineddefect type.
 6. The wafer defect inspection apparatus according to claim1, further comprising a threshold value decider configured to decide thepredetermined threshold value to each of the inspection target pictureelements based on the reference moving average gray level of each of theinspection target picture elements.
 7. The wafer defect inspectionapparatus according to claim 6, wherein the threshold value decider isconfigured to decide a value that is obtained by multiplying thereference moving average gray level by the predetermined value as thepredetermined threshold value.
 8. A method for inspecting a wafer defectbased on an image of a wafer that is an inspection target, comprising:calculating a gray level that has been obtained by averaging gray levelsof a plurality of picture elements in the a predetermined rangeincluding an inspection target picture element in a plurality of pictureelements that are arranged in the a predetermined line direction as areference moving average gray level of the inspection target pictureelement for each of the inspection target picture elements in a rangethat is an inspection target of the wafer in the image; calculating adifferential value between the reference moving average gray level ofthe inspection target picture element and a gray level of the inspectiontarget picture element for each of the inspection target pictureelements; judging whether each of the inspection target picture elementsis a defect candidate picture element by comparing the differentialvalue for each of the inspection target picture elements with the apredetermined threshold value; and inspecting a defect of the waferbased on the defect candidate picture element.